package BookDB;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class h2DB {

	static {
	       try{
	    	
	    	   Class.forName("org.h2.Driver");
	       }
	       catch (ClassNotFoundException e)
	       {
	    	   e.printStackTrace();
	       }
		}
		
		public static Connection getConnection(){
			try
			{
				Connection con=  DriverManager.getConnection("jdbc:h2:tcp://cm309.no-ip.org:9092/~/CM309_TEAM_C", "sa", "");
				con.setAutoCommit(false);
				con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
				return con;				
			
			}
			catch (SQLException e)
			{
				throw new RuntimeException(e);
			}
		}

	
}
